package com.leyou.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ly.plus.entity.Brand;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;


public interface BrandMapper extends BaseMapper<Brand> {
    /**
     * 维护多表中间表
     * @param cids
     */
    void saveCategoryAndBrand(@Param("cids") List<Long> cids, @Param("bid") Long bid);
    @Select("select b.* " +
            "from tb_brand b " +
            "    inner join tb_category_brand cb " +
            "        on b.id = cb.brand_id " +
            "           where 1=1 " +
            "             and cb.category_id=#{id};")
    List<Brand> fingBrandByCid(Long id);
}
